package me.liuyu2783.dubbo.sample.netty;

import me.liuyu2783.dubbo.sample.dubbo.Invocation;
import me.liuyu2783.dubbo.sample.dubbo.Protocol;
import me.liuyu2783.dubbo.sample.dubbo.URL;

/**
 * me.liuyu2783.dubbo.sample.netty
 *
 * @author liuyu2783
 * @date 2020-3-3
 */
public class NettyProtocal implements Protocol {

    @Override
    public void start(URL url) {
        new NettyServer().start(url.getPort());
    }

    @Override
    public String send(URL url, Invocation invocation) {
        return new NettyClient().send(url.getHost(),url.getPort(), invocation);
    }
}
